<?php
require_once("../php/connection.php");



// corrects the table site_group_members as in is inserts names where the names are not available
$res = mysql_query("DELETE FROM site_group_members WHERE `fbid`='' OR `del`='1'");
if(!$res) echo mysql_error();



$res = mysql_query("SELECT * FROM site_group_members WHERE `del`!='1' AND `username`=' '");

while($row = mysql_fetch_array($res))
{
	
	$fbid = $row['fbid'];
	$rowid = $row['id'];
	
	if($fbid == "") continue;
		
	$name = mysql_result(mysql_query("SELECT `name` FROM site_user_meta WHERE `fbid`='$fbid'"), 0, 'name');
	$res1 = mysql_query("UPDATE site_group_members SET `username`='$name' WHERE `id`='$rowid'");
	if(!$res1) echo  mysql_error();
	echo $rowid.' '.$fbid.' '.$name.'<br>';
}

?>